package com.zlll.winner.service.media;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zlll.winner.business.model.media.MediaMenu;
import com.zlll.winner.mapper.media.MediaMenuMapper;
import com.zlll.winner.business.service.media.IMediaMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author qsx
 * @since 2019-10-07
 */
@Service
public class MediaMenuServiceImpl extends ServiceImpl<MediaMenuMapper, MediaMenu> implements IMediaMenuService {

    /**
     * 获取栏目信息
     * @return
     */
    @Override
    public List<MediaMenu> getAllMediaMenu(Integer type) {
        LambdaQueryWrapper<MediaMenu> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(MediaMenu::getType, type);
        wrapper.eq(MediaMenu::getIsDel, 0);
        return list(wrapper);
    }
}
